<?php
/**
 * 数组的学习
 */
    $array=array("asp","php","jsp");
    echo "<pre>";
    print_r($array);
    echo "<br>";

    $projet=array(1=>'明日科技','imyou','hhl','iloveyou');//下表从一开始
    print_r($projet);//Array ( [1] => 明日科技 [2] => imyou [3] => hhl [4] => iloveyou )

    //创建一个关联数组
    echo "<br>";
    $newarray=array('明日科技'=>1,'imyou'=>2,'hhl'=>3,'iloveyou'=>4);
    print_r($newarray);
    //二维数组
    /**
    Array
    (
    [0] => asp
    [1] => php
    [2] => jsp
    )

    Array
    (
    [1] => 明日科技
    [2] => imyou
    [3] => hhl
    [4] => iloveyou
    )

    Array
    (
    [明日科技] => 1
    [imyou] => 2
    [hhl] => 3
    [iloveyou] => 4
    )**/
    $str=array(
        "书籍"=>array("文学","历史","地理"),
        "体育用品"=>array("m"=>"足球","n"=>"篮球"),
        "水果"=>array("橙子",8=>"葡萄","苹果"));
    echo "<pre>";
    print_r($str);
    /**
    Array
    (
    [书籍] => Array
    (
    [0] => 文学
    [1] => 历史
    [2] => 地理
    )

    [体育用品] => Array
    (
    [m] => 足球
    [n] => 篮球
    )

    [水果] => Array
    (
    [0] => 橙子
    [8] => 葡萄
    [9] => 苹果
    )

    )**/

    $str1=array(
        "书籍"=>array("文学"=>array('《红楼梦》','《水浒传》'),"历史"=>array('《中华上下五千年》')),
        "体育用品"=>array("m"=>"足球","n"=>"篮球"),
        "水果"=>array('橙子',8=>"橘子","苹果")
    );
    echo "<pre>";
    print_r($str1);

    ?>